<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\common\exception\UploadException;
use app\common\library\Upload;
use app\common\model\Area;
use app\common\model\Version;
use EasyWeChat\Kernel\Messages\Image;
use fast\Random;
use tencent\api\Im;
use think\captcha\Captcha;
use think\Config;
use think\Hook;


class Chat extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = '*';


    /**
     * Account:腾讯IM发送消息
     * User: Ixiangang
     * Date: 2025/2/11
     * Time: 13:39
     */
    public function send()
    {
        $com = $this->request->post('com');
        $im = new Im();
        $demo = $im->from_to("user3", "consultant5", $com);
        var_dump($demo);
    }


    /**
     * Account:获取聊天记录
     * User: Ixiangang
     * Date: 2025/2/11
     * Time: 14:54
     */
    public function demo()
    {
        $im = new Im();
        $start_time = time() - 120 * 60;
        $end_time = time() + 120 * 60;
        $demo = $im->chat_history("user3", "consultant5", 15, $start_time, $end_time);
        var_dump($demo);
    }




}